package com.bra.ui.adapter;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.bra.R;
import com.bra.bean.VenueDetailsBean;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
/**
 * 场馆详情界面的球类adapter
 * @author lenovo
 *
 */
public class VenueDetails_ballgame_Adapter {

	private LayoutInflater mInflater;
	private List<VenueDetailsBean> cgxqbeans;

	public VenueDetails_ballgame_Adapter(Context context, List<VenueDetailsBean> cgxqbeans) {
		mInflater = LayoutInflater.from(context);
		this.cgxqbeans = cgxqbeans;
	}

	public int getCount() {
		return cgxqbeans.size();
	}

	public Object getItem(int position) {
		return cgxqbeans.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder viewHolder = null;
		if (convertView == null) {
			viewHolder = new ViewHolder();
			convertView = mInflater
					.inflate(R.layout.venuedetails_ballgame_item, parent, false);
			viewHolder.mText = (TextView) convertView
					.findViewById(R.id.cdxq_qiulei_text);

			convertView.setTag(viewHolder);
		} else {
			viewHolder = (ViewHolder) convertView.getTag();
		}

		viewHolder.mText.setText(cgxqbeans.get(position).getProjectName());
		return convertView;
	}

	private class ViewHolder {
		ImageView mImg;
		TextView mText;
	}

}
